#ifndef LOD_FONT_RELATED_H
#define LOD_FONT_RELATED_H

#define BITMAP_FONT_MODE GLUT_BITMAP_HELVETICA_18
#include <GL/gl.h>
#include <GL/glut.h>
#include <string>

static inline void PushOrtho(int w, int h) {
  glMatrixMode(GL_PROJECTION);
  glPushMatrix();
  glLoadIdentity();
  gluOrtho2D(0,w,0,h);

  glMatrixMode(GL_MODELVIEW);
  glPushMatrix();
  glLoadIdentity();
}

static inline void PopOrtho() {
  glMatrixMode(GL_PROJECTION);
  glPopMatrix();
  glMatrixMode(GL_MODELVIEW);
  glPopMatrix();
}

static inline void DrawString(const char* str, float x, float y) {
  glRasterPos2f(x, y);
  int l = strlen(str);
  int i = 0;
  while(i < l)
    glutBitmapCharacter(BITMAP_FONT_MODE, str[i++]);
}

#endif
